const models = {};

function add(clsName, modName) {
  const modClass = require('./' + modName);
  models[clsName] = {
    'clsName': clsName,
    'modName': modName,
    'class': modClass
  };
}

async function init() {
  add('Log', 'log');
}

function create(name, session) {
  const module = models[name];
  return new module['class'](session);
}

exports.init = init;
exports.create = create;
